<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../../Templates/SubFolderTemplate.xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="head-title">
        <title>Add Material Batch | Merlion's ERP System</title>
    </ui:define>
    
    <ui:define name="content">
        <h:form>
            <p:panel id="panel" header="Add New Material Batch"> 
                <p:ajaxStatus style="width:16px;height:16px;">   
                    <f:facet name="start">   
                        <p:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" /> 
                    </f:facet> 
 
                    <f:facet name="complete">   
                        <h:outputText value="" />   
                    </f:facet>   
                </p:ajaxStatus> 
 
                <p:messages /> 
 
                <h:panelGrid columns="3" cellpadding="10"> 
                   
                    <h:outputLabel for="materialType" style="font-weight: bold" value="Material Type: " /> 
                    <h:selectOneMenu id="materialType" value="#{addMaterialBatchManagerBean.materialType}" >
                        <f:selectItem itemValue="Oats" itemLabel="Oats" id="A"/>
                        <f:selectItem itemValue="Wheat Germ" itemLabel="Wheat Germ" id="B"/>
                        <f:selectItem itemValue="Cinnamon" itemLabel="Cinnamon" id="C"/>
                        <f:selectItem itemValue="Nutmeg" itemLabel="Nutmeg" id="D"/>
                        <f:selectItem itemValue="Cloves" itemLabel="Cloves" id="E"/>
                        <f:selectItem itemValue="Honey" itemLabel="Honey" id="F"/>
                        <f:selectItem itemValue="Canola" itemLabel="Canola" id="G"/>
                        <f:selectItem itemValue="Vitamin/Mineral Powder" itemLabel="Vitamin/Mineral Powder" id="H"/>
                        <f:selectItem itemValue="Carob Chips" itemLabel="Carob Chips" id="I"/>
                        <f:selectItem itemValue="Protein Powder" itemLabel="Protein Powder" id="J"/>
                        <f:selectItem itemValue="Cocoa Powder'" itemLabel="Cocoa Powder'" id="K"/>
                        <f:selectItem itemValue="Hazenuts" itemLabel="Hazenuts" id="L"/>
                        <f:selectItem itemValue="Cashew Nuts" itemLabel="Cashew Nuts" id="M"/>
                        <f:selectItem itemValue="Walnuts" itemLabel="Walnuts" id="N"/>
                        <f:selectItem itemValue="Almonds" itemLabel="Almonds" id="O"/>
                        <f:selectItem itemValue="Macadamias" itemLabel="Macadamias" id="P"/>
                        <f:selectItem itemValue="Redcurrants" itemLabel="Redcurrants" id="Q"/>
                        <f:selectItem itemValue="Rasins" itemLabel="Rasins" id="R"/>
                        <f:selectItem itemValue="Dates" itemLabel="Dates" id="S"/>
                        <f:selectItem itemValue="Apricots" itemLabel="Apricots" id="T"/>
                        <f:selectItem itemValue="Kiwis" itemLabel="Kiwis" id="U"/>
                        <f:selectItem itemValue="Apples" itemLabel="Apples" id="V"/>
                        <f:selectItem itemValue="Peaches" itemLabel="Peaches" id="W"/>   
                    </h:selectOneMenu>
                    <p:message for="materialType" /> 
                    
                    <h:outputLabel for="quantity" style="font-weight: bold" value="Quantity: " /> 
                    <p:inputText required="true" label="quantity" requiredMessage="Quantity is required." id="quantity" value="#{addMaterialBatchManagerBean.quantity}">                         
                    </p:inputText> 
                    <p:message for="quantity" /> 
 
                    <h:outputLabel for="location" style="font-weight: bold" value="Location: " /> 
                    <p:inputText required="true" label="location" requiredMessage="Location is required." id="location" value="#{addMaterialBatchManagerBean.location}">                         
                    </p:inputText> 
                    <p:message for="location" />
                    
                    <h4>Expiry Date:</h4>  
                    <p:calendar value="#{addMaterialBatchManagerBean.expiryDate}" pattern="dd.MM.yyyy" /> 
                    
                </h:panelGrid>
                
                <p:commandButton id="btn" value="Save New Material Batch" update="panel" actionListener="#{addMaterialBatchManagerBean.saveNewMaterialBatch(event)}" ajax="true" />
                <p:commandButton value="Clear" type="reset"/>
            </p:panel> 
        </h:form>
    </ui:define>

</ui:composition>
